package exception;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

/**
 *
 */
public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("start");
        try{
            String line="";
            System.out.println(line.charAt(0));
            String s=null;
            System.out.println(s.length());

            String line2="abc";
            System.out.println(Integer.parseInt(line2));
        } catch (NullPointerException exception ){
            System.out.println("反正出现了nullPointer异常");
        }catch (StringIndexOutOfBoundsException e){
            System.out.println("出现了字符串下标越界异常");
        }catch(NumberFormatException e){
            System.out.println("NumberFormatException");
        }

        System.out.println("end");
    }
}
